﻿using System;
using System.Diagnostics;
using Smarly.Idml.RelaxNg.Generator.Model;
using Tenuto.Grammar;

namespace Smarly.Idml.RelaxNg.Generator.Proxy
{
	public class ExpressionTextExpBuilder : Builder<Expression.TextExp>
	{
		[DebuggerStepThrough]
		protected internal ExpressionTextExpBuilder(Expression.TextExp exp, Action<IObjectName> updateName) : base(exp, updateName) { }

		public override IStruct Fill(IStruct getStruct)
		{
			getStruct = base.Fill(getStruct);

			if (getStruct is AttrStruct)
			{
				//todo implement
			}
			else if (getStruct is ObjectStruct)
			{
				//todo implement
			}
			else
			{
				//todo remove condition
				if (getStruct == null)
					return getStruct;

				throw new NotImplementedException("Not implement for type - " + getStruct.GetType().FullName);
			}

			return getStruct;
		}
	}
}